

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />

  <title>Listen Attend Spell Model &mdash; Openspeech v0.3.0 documentation</title>



  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />










  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->


      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/language_data.js"></script>

    <script type="text/javascript" src="../_static/js/theme.js"></script>


    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="LSTM Language Model" href="LSTM LM.html" />
    <link rel="prev" title="Jasper" href="Jasper.html" />
</head>

<body class="wy-body-for-nav">


  <div class="wy-grid-for-nav">

    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >



            <a href="../index.html" class="icon icon-home"> Openspeech



          </a>







<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>


        </div>


        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">






              <p class="caption"><span class="caption-text">GETTING STARTED</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../notes/intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes/hydra_configs.html">Openspeech’s Hydra configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes/configs.html">Openspeech’s configurations</a></li>
</ul>
<p class="caption"><span class="caption-text">OPENSPEECH MODELS</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../models/Openspeech Model.html">Openspeech Model</a></li>
<li class="toctree-l1"><a class="reference internal" href="../models/Openspeech CTC Model.html">Openspeech CTC Model</a></li>
<li class="toctree-l1"><a class="reference internal" href="../models/Openspeech Encoder Decoder Model.html">Openspeech Encoder Decoder Model</a></li>
<li class="toctree-l1"><a class="reference internal" href="../models/Openspeech Transducer Model.html">Openspeech Transducer Model</a></li>
<li class="toctree-l1"><a class="reference internal" href="../models/Openspeech Language Model.html">Openspeech Language Model</a></li>
</ul>
<p class="caption"><span class="caption-text">MODEL ARCHITECTURES</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="Conformer.html">Conformer</a></li>
<li class="toctree-l1"><a class="reference internal" href="ContextNet.html">ContextNet</a></li>
<li class="toctree-l1"><a class="reference internal" href="DeepSpeech2.html">DeepSpeech2</a></li>
<li class="toctree-l1"><a class="reference internal" href="Jasper.html">Jasper</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Listen Attend Spell Model</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">Listen Attend Spell Model</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-openspeech.models.listen_attend_spell.configurations">Listen Attend Spell Model Configuration</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="LSTM LM.html">LSTM Language Model</a></li>
<li class="toctree-l1"><a class="reference internal" href="QuartzNet.html">QuartzNet Model</a></li>
<li class="toctree-l1"><a class="reference internal" href="RNN Transducer.html">RNN Transducer Model</a></li>
<li class="toctree-l1"><a class="reference internal" href="Transformer.html">Transformer Model</a></li>
<li class="toctree-l1"><a class="reference internal" href="Transformer LM.html">Transformer Language Model</a></li>
<li class="toctree-l1"><a class="reference internal" href="Transformer Transducer.html">Transformer Transducer Model</a></li>
</ul>
<p class="caption"><span class="caption-text">CORPUS</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../corpus/AISHELL-1.html">AISHELL</a></li>
<li class="toctree-l1"><a class="reference internal" href="../corpus/KsponSpeech.html">KsponSpeech</a></li>
<li class="toctree-l1"><a class="reference internal" href="../corpus/LibriSpeech.html">LibriSpeech</a></li>
</ul>
<p class="caption"><span class="caption-text">LIBRARY REFERENCE</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../modules/Callback.html">Callback</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/Criterion.html">Criterion</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/Data Augment.html">Data Augment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/Feature Transform.html">Feature Transform</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/Datasets.html">Datasets</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/Data Loaders.html">Data Loaders</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/Decoders.html">Decoders</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/Encoders.html">Encoders</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/Modules.html">Modules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/Optim.html">Optim</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/Search.html">Search</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/Tokenizers.html">Tokenizers</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/Metric.html">Metric</a></li>
</ul>



        </div>

      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">


      <nav class="wy-nav-top" aria-label="top navigation">

          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">Openspeech</a>

      </nav>


      <div class="wy-nav-content">

        <div class="rst-content">



















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">

      <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>

      <li>Listen Attend Spell Model</li>


      <li class="wy-breadcrumbs-aside">


            <a href="../_sources/architectures/Listen Attend Spell.rst.txt" rel="nofollow"> View page source</a>


      </li>

  </ul>


  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">

  <div class="section" id="listen-attend-spell-model">
<h1>Listen Attend Spell Model<a class="headerlink" href="#listen-attend-spell-model" title="Permalink to this headline">¶</a></h1>
<div class="section" id="id1">
<h2>Listen Attend Spell Model<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<span class="target" id="module-openspeech.models.listen_attend_spell.model"></span><dl class="py class">
<dt id="openspeech.models.listen_attend_spell.model.DeepCNNWithJointCTCListenAttendSpellModel">
<em class="property">class </em><code class="sig-prename descclassname">openspeech.models.listen_attend_spell.model.</code><code class="sig-name descname">DeepCNNWithJointCTCListenAttendSpellModel</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">configs</span><span class="p">:</span> <span class="n">omegaconf.dictconfig.DictConfig</span></em>, <em class="sig-param"><span class="n">tokenizer</span><span class="p">:</span> <span class="n"><a class="reference internal" href="../modules/Tokenizers.html#openspeech.tokenizers.tokenizer.Tokenizer" title="openspeech.tokenizers.tokenizer.Tokenizer">openspeech.tokenizers.tokenizer.Tokenizer</a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/model.html#DeepCNNWithJointCTCListenAttendSpellModel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.model.DeepCNNWithJointCTCListenAttendSpellModel" title="Permalink to this definition">¶</a></dt>
<dd><p>Listen, Attend and Spell model with configurable encoder and decoder.
Paper: <a class="reference external" href="https://arxiv.org/abs/1508.01211">https://arxiv.org/abs/1508.01211</a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>configs</strong> (<em>DictConfig</em>) – configuration set.</p></li>
<li><p><strong>tokenizer</strong> (<a class="reference internal" href="../modules/Tokenizers.html#openspeech.tokenizers.tokenizer.Tokenizer" title="openspeech.tokenizers.tokenizer.Tokenizer"><em>Tokenizer</em></a>) – tokenizer is in charge of preparing the inputs for a model.</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>Inputs:</dt><dd><ul class="simple">
<li><p><strong>inputs</strong> (torch.FloatTensor): A input sequence passed to encoders. Typically for inputs this will be a padded <cite>FloatTensor</cite> of size <code class="docutils literal notranslate"><span class="pre">(batch,</span> <span class="pre">seq_length,</span> <span class="pre">dimension)</span></code>.</p></li>
<li><p><strong>input_lengths</strong> (torch.LongTensor): The length of input tensor. <code class="docutils literal notranslate"><span class="pre">(batch)</span></code></p></li>
</ul>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Result of model predictions.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>outputs (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.9)">dict</a>)</p>
</dd>
</dl>
<dl class="py method">
<dt id="openspeech.models.listen_attend_spell.model.DeepCNNWithJointCTCListenAttendSpellModel.set_beam_decoder">
<code class="sig-name descname">set_beam_decoder</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">beam_size</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">3</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/model.html#DeepCNNWithJointCTCListenAttendSpellModel.set_beam_decoder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.model.DeepCNNWithJointCTCListenAttendSpellModel.set_beam_decoder" title="Permalink to this definition">¶</a></dt>
<dd><p>Setting beam search decoder</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="openspeech.models.listen_attend_spell.model.JointCTCListenAttendSpellModel">
<em class="property">class </em><code class="sig-prename descclassname">openspeech.models.listen_attend_spell.model.</code><code class="sig-name descname">JointCTCListenAttendSpellModel</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">configs</span><span class="p">:</span> <span class="n">omegaconf.dictconfig.DictConfig</span></em>, <em class="sig-param"><span class="n">tokenizer</span><span class="p">:</span> <span class="n"><a class="reference internal" href="../modules/Tokenizers.html#openspeech.tokenizers.tokenizer.Tokenizer" title="openspeech.tokenizers.tokenizer.Tokenizer">openspeech.tokenizers.tokenizer.Tokenizer</a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/model.html#JointCTCListenAttendSpellModel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.model.JointCTCListenAttendSpellModel" title="Permalink to this definition">¶</a></dt>
<dd><p>Joint CTC-Attention Listen, Attend and Spell model with configurable encoder and decoder.
Paper: <a class="reference external" href="https://arxiv.org/abs/1609.06773">https://arxiv.org/abs/1609.06773</a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>configs</strong> (<em>DictConfig</em>) – configuration set.</p></li>
<li><p><strong>tokenizer</strong> (<em>Tokeizer</em>) – tokenizer is in charge of preparing the inputs for a model.</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>Inputs:</dt><dd><ul class="simple">
<li><p><strong>inputs</strong> (torch.FloatTensor): A input sequence passed to encoders. Typically for inputs this will be a padded <cite>FloatTensor</cite> of size <code class="docutils literal notranslate"><span class="pre">(batch,</span> <span class="pre">seq_length,</span> <span class="pre">dimension)</span></code>.</p></li>
<li><p><strong>input_lengths</strong> (torch.LongTensor): The length of input tensor. <code class="docutils literal notranslate"><span class="pre">(batch)</span></code></p></li>
</ul>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Result of model predictions.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>outputs (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.9)">dict</a>)</p>
</dd>
</dl>
<dl class="py method">
<dt id="openspeech.models.listen_attend_spell.model.JointCTCListenAttendSpellModel.set_beam_decoder">
<code class="sig-name descname">set_beam_decoder</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">beam_size</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">3</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/model.html#JointCTCListenAttendSpellModel.set_beam_decoder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.model.JointCTCListenAttendSpellModel.set_beam_decoder" title="Permalink to this definition">¶</a></dt>
<dd><p>Setting beam search decoder</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="openspeech.models.listen_attend_spell.model.ListenAttendSpellModel">
<em class="property">class </em><code class="sig-prename descclassname">openspeech.models.listen_attend_spell.model.</code><code class="sig-name descname">ListenAttendSpellModel</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">configs</span><span class="p">:</span> <span class="n">omegaconf.dictconfig.DictConfig</span></em>, <em class="sig-param"><span class="n">tokenizer</span><span class="p">:</span> <span class="n"><a class="reference internal" href="../modules/Tokenizers.html#openspeech.tokenizers.tokenizer.Tokenizer" title="openspeech.tokenizers.tokenizer.Tokenizer">openspeech.tokenizers.tokenizer.Tokenizer</a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/model.html#ListenAttendSpellModel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.model.ListenAttendSpellModel" title="Permalink to this definition">¶</a></dt>
<dd><p>Listen, Attend and Spell model with configurable encoder and decoder.
Paper: <a class="reference external" href="https://arxiv.org/abs/1508.01211">https://arxiv.org/abs/1508.01211</a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>configs</strong> (<em>DictConfig</em>) – configuration set.</p></li>
<li><p><strong>tokenizer</strong> (<em>Tokeizer</em>) – tokenizer is in charge of preparing the inputs for a model.</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>Inputs:</dt><dd><ul class="simple">
<li><p><strong>inputs</strong> (torch.FloatTensor): A input sequence passed to encoders. Typically for inputs this will be a padded <cite>FloatTensor</cite> of size <code class="docutils literal notranslate"><span class="pre">(batch,</span> <span class="pre">seq_length,</span> <span class="pre">dimension)</span></code>.</p></li>
<li><p><strong>input_lengths</strong> (torch.LongTensor): The length of input tensor. <code class="docutils literal notranslate"><span class="pre">(batch)</span></code></p></li>
</ul>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Result of model predictions.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>outputs (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.9)">dict</a>)</p>
</dd>
</dl>
<dl class="py method">
<dt id="openspeech.models.listen_attend_spell.model.ListenAttendSpellModel.set_beam_decoder">
<code class="sig-name descname">set_beam_decoder</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">beam_size</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">3</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/model.html#ListenAttendSpellModel.set_beam_decoder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.model.ListenAttendSpellModel.set_beam_decoder" title="Permalink to this definition">¶</a></dt>
<dd><p>Setting beam search decoder</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="openspeech.models.listen_attend_spell.model.ListenAttendSpellWithLocationAwareModel">
<em class="property">class </em><code class="sig-prename descclassname">openspeech.models.listen_attend_spell.model.</code><code class="sig-name descname">ListenAttendSpellWithLocationAwareModel</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">configs</span><span class="p">:</span> <span class="n">omegaconf.dictconfig.DictConfig</span></em>, <em class="sig-param"><span class="n">tokenizer</span><span class="p">:</span> <span class="n"><a class="reference internal" href="../modules/Tokenizers.html#openspeech.tokenizers.tokenizer.Tokenizer" title="openspeech.tokenizers.tokenizer.Tokenizer">openspeech.tokenizers.tokenizer.Tokenizer</a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/model.html#ListenAttendSpellWithLocationAwareModel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.model.ListenAttendSpellWithLocationAwareModel" title="Permalink to this definition">¶</a></dt>
<dd><p>Listen, Attend and Spell model with configurable encoder and decoder.
Paper: <a class="reference external" href="https://arxiv.org/abs/1508.01211">https://arxiv.org/abs/1508.01211</a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>configs</strong> (<em>DictConfig</em>) – configuration set.</p></li>
<li><p><strong>tokenizer</strong> (<em>Tokeizer</em>) – tokenizer is in charge of preparing the inputs for a model.</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>Inputs:</dt><dd><ul class="simple">
<li><p><strong>inputs</strong> (torch.FloatTensor): A input sequence passed to encoders. Typically for inputs this will be a padded <cite>FloatTensor</cite> of size <code class="docutils literal notranslate"><span class="pre">(batch,</span> <span class="pre">seq_length,</span> <span class="pre">dimension)</span></code>.</p></li>
<li><p><strong>input_lengths</strong> (torch.LongTensor): The length of input tensor. <code class="docutils literal notranslate"><span class="pre">(batch)</span></code></p></li>
</ul>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Result of model predictions.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>outputs (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.9)">dict</a>)</p>
</dd>
</dl>
<dl class="py method">
<dt id="openspeech.models.listen_attend_spell.model.ListenAttendSpellWithLocationAwareModel.set_beam_decoder">
<code class="sig-name descname">set_beam_decoder</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">beam_size</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">3</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/model.html#ListenAttendSpellWithLocationAwareModel.set_beam_decoder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.model.ListenAttendSpellWithLocationAwareModel.set_beam_decoder" title="Permalink to this definition">¶</a></dt>
<dd><p>Setting beam search decoder</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="openspeech.models.listen_attend_spell.model.ListenAttendSpellWithMultiHeadModel">
<em class="property">class </em><code class="sig-prename descclassname">openspeech.models.listen_attend_spell.model.</code><code class="sig-name descname">ListenAttendSpellWithMultiHeadModel</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">configs</span><span class="p">:</span> <span class="n">omegaconf.dictconfig.DictConfig</span></em>, <em class="sig-param"><span class="n">tokenizer</span><span class="p">:</span> <span class="n"><a class="reference internal" href="../modules/Tokenizers.html#openspeech.tokenizers.tokenizer.Tokenizer" title="openspeech.tokenizers.tokenizer.Tokenizer">openspeech.tokenizers.tokenizer.Tokenizer</a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/model.html#ListenAttendSpellWithMultiHeadModel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.model.ListenAttendSpellWithMultiHeadModel" title="Permalink to this definition">¶</a></dt>
<dd><p>Listen, Attend and Spell model with configurable encoder and decoder.
Paper: <a class="reference external" href="https://arxiv.org/abs/1508.01211">https://arxiv.org/abs/1508.01211</a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>configs</strong> (<em>DictConfig</em>) – configuration set.</p></li>
<li><p><strong>tokenizer</strong> (<em>Tokeizer</em>) – tokenizer is in charge of preparing the inputs for a model.</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>Inputs:</dt><dd><ul class="simple">
<li><p><strong>inputs</strong> (torch.FloatTensor): A input sequence passed to encoders. Typically for inputs this will be a padded <cite>FloatTensor</cite> of size <code class="docutils literal notranslate"><span class="pre">(batch,</span> <span class="pre">seq_length,</span> <span class="pre">dimension)</span></code>.</p></li>
<li><p><strong>input_lengths</strong> (torch.LongTensor): The length of input tensor. <code class="docutils literal notranslate"><span class="pre">(batch)</span></code></p></li>
</ul>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Result of model predictions.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>outputs (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.9)">dict</a>)</p>
</dd>
</dl>
<dl class="py method">
<dt id="openspeech.models.listen_attend_spell.model.ListenAttendSpellWithMultiHeadModel.set_beam_decoder">
<code class="sig-name descname">set_beam_decoder</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">beam_size</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">3</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/model.html#ListenAttendSpellWithMultiHeadModel.set_beam_decoder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.model.ListenAttendSpellWithMultiHeadModel.set_beam_decoder" title="Permalink to this definition">¶</a></dt>
<dd><p>Setting beam search decoder</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-openspeech.models.listen_attend_spell.configurations">
<span id="listen-attend-spell-model-configuration"></span><h2>Listen Attend Spell Model Configuration<a class="headerlink" href="#module-openspeech.models.listen_attend_spell.configurations" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt id="openspeech.models.listen_attend_spell.configurations.DeepCNNWithJointCTCListenAttendSpellConfigs">
<em class="property">class </em><code class="sig-prename descclassname">openspeech.models.listen_attend_spell.configurations.</code><code class="sig-name descname">DeepCNNWithJointCTCListenAttendSpellConfigs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model_name</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'deep_cnn_with_joint_ctc_listen_attend_spell'</span></em>, <em class="sig-param"><span class="n">num_encoder_layers</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">3</span></em>, <em class="sig-param"><span class="n">num_decoder_layers</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">2</span></em>, <em class="sig-param"><span class="n">hidden_state_dim</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">768</span></em>, <em class="sig-param"><span class="n">encoder_dropout_p</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">0.3</span></em>, <em class="sig-param"><span class="n">encoder_bidirectional</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)">bool</a></span> <span class="o">=</span> <span class="default_value">True</span></em>, <em class="sig-param"><span class="n">rnn_type</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'lstm'</span></em>, <em class="sig-param"><span class="n">extractor</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'vgg'</span></em>, <em class="sig-param"><span class="n">activation</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'hardtanh'</span></em>, <em class="sig-param"><span class="n">joint_ctc_attention</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)">bool</a></span> <span class="o">=</span> <span class="default_value">True</span></em>, <em class="sig-param"><span class="n">max_length</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">128</span></em>, <em class="sig-param"><span class="n">num_attention_heads</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">1</span></em>, <em class="sig-param"><span class="n">decoder_dropout_p</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">0.2</span></em>, <em class="sig-param"><span class="n">decoder_attn_mechanism</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'loc'</span></em>, <em class="sig-param"><span class="n">teacher_forcing_ratio</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">optimizer</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'adam'</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/configurations.html#DeepCNNWithJointCTCListenAttendSpellConfigs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.configurations.DeepCNNWithJointCTCListenAttendSpellConfigs" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the configuration class to store the configuration of
a <code class="xref py py-class docutils literal notranslate"><span class="pre">DeepCNNWithJointCTCListenAttendSpell</span></code>.</p>
<p>It is used to initiated an <cite>DeepCNNWithJointCTCListenAttendSpell</cite> model.</p>
<p>Configuration objects inherit from :class: <cite>~openspeech.dataclass.configs.OpenspeechDataclass</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Model name (default: deep_cnn_with_joint_ctc_listen_attend_spell)</p></li>
<li><p><strong>num_encoder_layers</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of encoder layers. (default: 3)</p></li>
<li><p><strong>num_decoder_layers</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of decoder layers. (default: 2)</p></li>
<li><p><strong>hidden_state_dim</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The hidden state dimension of encoder. (default: 768)</p></li>
<li><p><strong>encoder_dropout_p</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The dropout probability of encoder. (default: 0.3)</p></li>
<li><p><strong>encoder_bidirectional</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a>) – If True, becomes a bidirectional encoders (default: True)</p></li>
<li><p><strong>rnn_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Type of rnn cell (rnn, lstm, gru) (default: lstm)</p></li>
<li><p><strong>extractor</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – The CNN feature extractor. (default: vgg)</p></li>
<li><p><strong>activation</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Type of activation function (default: str)</p></li>
<li><p><strong>joint_ctc_attention</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a>) – Flag indication joint ctc attention or not (default: True)</p></li>
<li><p><strong>max_length</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – Max decoding length. (default: 128)</p></li>
<li><p><strong>num_attention_heads</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of attention heads. (default: 1)</p></li>
<li><p><strong>decoder_dropout_p</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The dropout probability of decoder. (default: 0.2)</p></li>
<li><p><strong>decoder_attn_mechanism</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – The attention mechanism for decoder. (default: loc)</p></li>
<li><p><strong>teacher_forcing_ratio</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The ratio of teacher forcing. (default: 1.0)</p></li>
<li><p><strong>optimizer</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Optimizer for training. (default: adam)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt id="openspeech.models.listen_attend_spell.configurations.JointCTCListenAttendSpellConfigs">
<em class="property">class </em><code class="sig-prename descclassname">openspeech.models.listen_attend_spell.configurations.</code><code class="sig-name descname">JointCTCListenAttendSpellConfigs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model_name</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'joint_ctc_listen_attend_spell'</span></em>, <em class="sig-param"><span class="n">num_encoder_layers</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">3</span></em>, <em class="sig-param"><span class="n">num_decoder_layers</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">2</span></em>, <em class="sig-param"><span class="n">hidden_state_dim</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">768</span></em>, <em class="sig-param"><span class="n">encoder_dropout_p</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">0.3</span></em>, <em class="sig-param"><span class="n">encoder_bidirectional</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)">bool</a></span> <span class="o">=</span> <span class="default_value">True</span></em>, <em class="sig-param"><span class="n">rnn_type</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'lstm'</span></em>, <em class="sig-param"><span class="n">joint_ctc_attention</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)">bool</a></span> <span class="o">=</span> <span class="default_value">True</span></em>, <em class="sig-param"><span class="n">max_length</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">128</span></em>, <em class="sig-param"><span class="n">num_attention_heads</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">1</span></em>, <em class="sig-param"><span class="n">decoder_dropout_p</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">0.2</span></em>, <em class="sig-param"><span class="n">decoder_attn_mechanism</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'loc'</span></em>, <em class="sig-param"><span class="n">teacher_forcing_ratio</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">optimizer</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'adam'</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/configurations.html#JointCTCListenAttendSpellConfigs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.configurations.JointCTCListenAttendSpellConfigs" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the configuration class to store the configuration of
a <code class="xref py py-class docutils literal notranslate"><span class="pre">JointCTCListenAttendSpell</span></code>.</p>
<p>It is used to initiated an <cite>JointCTCListenAttendSpell</cite> model.</p>
<p>Configuration objects inherit from :class: <cite>~openspeech.dataclass.configs.OpenspeechDataclass</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Model name (default: joint_ctc_listen_attend_spell)</p></li>
<li><p><strong>num_encoder_layers</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of encoder layers. (default: 3)</p></li>
<li><p><strong>num_decoder_layers</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of decoder layers. (default: 2)</p></li>
<li><p><strong>hidden_state_dim</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The hidden state dimension of encoder. (default: 768)</p></li>
<li><p><strong>encoder_dropout_p</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The dropout probability of encoder. (default: 0.3)</p></li>
<li><p><strong>encoder_bidirectional</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a>) – If True, becomes a bidirectional encoders (default: True)</p></li>
<li><p><strong>rnn_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Type of rnn cell (rnn, lstm, gru) (default: lstm)</p></li>
<li><p><strong>joint_ctc_attention</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a>) – Flag indication joint ctc attention or not (default: True)</p></li>
<li><p><strong>max_length</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – Max decoding length. (default: 128)</p></li>
<li><p><strong>num_attention_heads</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of attention heads. (default: 1)</p></li>
<li><p><strong>decoder_dropout_p</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The dropout probability of decoder. (default: 0.2)</p></li>
<li><p><strong>decoder_attn_mechanism</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – The attention mechanism for decoder. (default: loc)</p></li>
<li><p><strong>teacher_forcing_ratio</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The ratio of teacher forcing. (default: 1.0)</p></li>
<li><p><strong>optimizer</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Optimizer for training. (default: adam)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt id="openspeech.models.listen_attend_spell.configurations.ListenAttendSpellConfigs">
<em class="property">class </em><code class="sig-prename descclassname">openspeech.models.listen_attend_spell.configurations.</code><code class="sig-name descname">ListenAttendSpellConfigs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model_name</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'listen_attend_spell'</span></em>, <em class="sig-param"><span class="n">num_encoder_layers</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">3</span></em>, <em class="sig-param"><span class="n">num_decoder_layers</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">2</span></em>, <em class="sig-param"><span class="n">hidden_state_dim</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">512</span></em>, <em class="sig-param"><span class="n">encoder_dropout_p</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">0.3</span></em>, <em class="sig-param"><span class="n">encoder_bidirectional</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)">bool</a></span> <span class="o">=</span> <span class="default_value">True</span></em>, <em class="sig-param"><span class="n">rnn_type</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'lstm'</span></em>, <em class="sig-param"><span class="n">joint_ctc_attention</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)">bool</a></span> <span class="o">=</span> <span class="default_value">False</span></em>, <em class="sig-param"><span class="n">max_length</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">128</span></em>, <em class="sig-param"><span class="n">num_attention_heads</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">1</span></em>, <em class="sig-param"><span class="n">decoder_dropout_p</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">0.2</span></em>, <em class="sig-param"><span class="n">decoder_attn_mechanism</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'dot'</span></em>, <em class="sig-param"><span class="n">teacher_forcing_ratio</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">optimizer</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'adam'</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/configurations.html#ListenAttendSpellConfigs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.configurations.ListenAttendSpellConfigs" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the configuration class to store the configuration of
a <code class="xref py py-class docutils literal notranslate"><span class="pre">ListenAttendSpell</span></code>.</p>
<p>It is used to initiated an <cite>ListenAttendSpell</cite> model.</p>
<p>Configuration objects inherit from :class: <cite>~openspeech.dataclass.configs.OpenspeechDataclass</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Model name (default: listen_attend_spell)</p></li>
<li><p><strong>num_encoder_layers</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of encoder layers. (default: 3)</p></li>
<li><p><strong>num_decoder_layers</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of decoder layers. (default: 2)</p></li>
<li><p><strong>hidden_state_dim</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The hidden state dimension of encoder. (default: 512)</p></li>
<li><p><strong>encoder_dropout_p</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The dropout probability of encoder. (default: 0.3)</p></li>
<li><p><strong>encoder_bidirectional</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a>) – If True, becomes a bidirectional encoders (default: True)</p></li>
<li><p><strong>rnn_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Type of rnn cell (rnn, lstm, gru) (default: lstm)</p></li>
<li><p><strong>joint_ctc_attention</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a>) – Flag indication joint ctc attention or not (default: False)</p></li>
<li><p><strong>max_length</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – Max decoding length. (default: 128)</p></li>
<li><p><strong>num_attention_heads</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of attention heads. (default: 1)</p></li>
<li><p><strong>decoder_dropout_p</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The dropout probability of decoder. (default: 0.2)</p></li>
<li><p><strong>decoder_attn_mechanism</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – The attention mechanism for decoder. (default: dot)</p></li>
<li><p><strong>teacher_forcing_ratio</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The ratio of teacher forcing. (default: 1.0)</p></li>
<li><p><strong>optimizer</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Optimizer for training. (default: adam)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt id="openspeech.models.listen_attend_spell.configurations.ListenAttendSpellWithLocationAwareConfigs">
<em class="property">class </em><code class="sig-prename descclassname">openspeech.models.listen_attend_spell.configurations.</code><code class="sig-name descname">ListenAttendSpellWithLocationAwareConfigs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model_name</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'listen_attend_spell_with_location_aware'</span></em>, <em class="sig-param"><span class="n">num_encoder_layers</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">3</span></em>, <em class="sig-param"><span class="n">num_decoder_layers</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">2</span></em>, <em class="sig-param"><span class="n">hidden_state_dim</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">512</span></em>, <em class="sig-param"><span class="n">encoder_dropout_p</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">0.3</span></em>, <em class="sig-param"><span class="n">encoder_bidirectional</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)">bool</a></span> <span class="o">=</span> <span class="default_value">True</span></em>, <em class="sig-param"><span class="n">rnn_type</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'lstm'</span></em>, <em class="sig-param"><span class="n">joint_ctc_attention</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)">bool</a></span> <span class="o">=</span> <span class="default_value">False</span></em>, <em class="sig-param"><span class="n">max_length</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">128</span></em>, <em class="sig-param"><span class="n">num_attention_heads</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">1</span></em>, <em class="sig-param"><span class="n">decoder_dropout_p</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">0.2</span></em>, <em class="sig-param"><span class="n">decoder_attn_mechanism</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'loc'</span></em>, <em class="sig-param"><span class="n">teacher_forcing_ratio</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">optimizer</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'adam'</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/configurations.html#ListenAttendSpellWithLocationAwareConfigs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.configurations.ListenAttendSpellWithLocationAwareConfigs" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the configuration class to store the configuration of
a <code class="xref py py-class docutils literal notranslate"><span class="pre">ListenAttendSpellWithLocationAware</span></code>.</p>
<p>It is used to initiated an <cite>ListenAttendSpellWithLocationAware</cite> model.</p>
<p>Configuration objects inherit from :class: <cite>~openspeech.dataclass.configs.OpenspeechDataclass</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Model name (default: listen_attend_spell_with_location_aware)</p></li>
<li><p><strong>num_encoder_layers</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of encoder layers. (default: 3)</p></li>
<li><p><strong>num_decoder_layers</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of decoder layers. (default: 2)</p></li>
<li><p><strong>hidden_state_dim</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The hidden state dimension of encoder. (default: 512)</p></li>
<li><p><strong>encoder_dropout_p</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The dropout probability of encoder. (default: 0.3)</p></li>
<li><p><strong>encoder_bidirectional</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a>) – If True, becomes a bidirectional encoders (default: True)</p></li>
<li><p><strong>rnn_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Type of rnn cell (rnn, lstm, gru) (default: lstm)</p></li>
<li><p><strong>joint_ctc_attention</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a>) – Flag indication joint ctc attention or not (default: False)</p></li>
<li><p><strong>max_length</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – Max decoding length. (default: 128)</p></li>
<li><p><strong>num_attention_heads</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of attention heads. (default: 1)</p></li>
<li><p><strong>decoder_dropout_p</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The dropout probability of decoder. (default: 0.2)</p></li>
<li><p><strong>decoder_attn_mechanism</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – The attention mechanism for decoder. (default: loc)</p></li>
<li><p><strong>teacher_forcing_ratio</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The ratio of teacher forcing. (default: 1.0)</p></li>
<li><p><strong>optimizer</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Optimizer for training. (default: adam)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt id="openspeech.models.listen_attend_spell.configurations.ListenAttendSpellWithMultiHeadConfigs">
<em class="property">class </em><code class="sig-prename descclassname">openspeech.models.listen_attend_spell.configurations.</code><code class="sig-name descname">ListenAttendSpellWithMultiHeadConfigs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model_name</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'listen_attend_spell_with_multi_head'</span></em>, <em class="sig-param"><span class="n">num_encoder_layers</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">3</span></em>, <em class="sig-param"><span class="n">num_decoder_layers</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">2</span></em>, <em class="sig-param"><span class="n">hidden_state_dim</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">512</span></em>, <em class="sig-param"><span class="n">encoder_dropout_p</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">0.3</span></em>, <em class="sig-param"><span class="n">encoder_bidirectional</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)">bool</a></span> <span class="o">=</span> <span class="default_value">True</span></em>, <em class="sig-param"><span class="n">rnn_type</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'lstm'</span></em>, <em class="sig-param"><span class="n">joint_ctc_attention</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)">bool</a></span> <span class="o">=</span> <span class="default_value">False</span></em>, <em class="sig-param"><span class="n">max_length</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">128</span></em>, <em class="sig-param"><span class="n">num_attention_heads</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></span> <span class="o">=</span> <span class="default_value">4</span></em>, <em class="sig-param"><span class="n">decoder_dropout_p</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">0.2</span></em>, <em class="sig-param"><span class="n">decoder_attn_mechanism</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'multi-head'</span></em>, <em class="sig-param"><span class="n">teacher_forcing_ratio</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></span> <span class="o">=</span> <span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">optimizer</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a></span> <span class="o">=</span> <span class="default_value">'adam'</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/openspeech/models/listen_attend_spell/configurations.html#ListenAttendSpellWithMultiHeadConfigs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#openspeech.models.listen_attend_spell.configurations.ListenAttendSpellWithMultiHeadConfigs" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the configuration class to store the configuration of
a <code class="xref py py-class docutils literal notranslate"><span class="pre">ListenAttendSpellWithMultiHead</span></code>.</p>
<p>It is used to initiated an <cite>ListenAttendSpellWithMultiHead</cite> model.</p>
<p>Configuration objects inherit from :class: <cite>~openspeech.dataclass.configs.OpenspeechDataclass</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Model name (default: listen_attend_spell_with_multi_head)</p></li>
<li><p><strong>num_encoder_layers</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of encoder layers. (default: 3)</p></li>
<li><p><strong>num_decoder_layers</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of decoder layers. (default: 2)</p></li>
<li><p><strong>hidden_state_dim</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The hidden state dimension of encoder. (default: 512)</p></li>
<li><p><strong>encoder_dropout_p</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The dropout probability of encoder. (default: 0.3)</p></li>
<li><p><strong>encoder_bidirectional</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a>) – If True, becomes a bidirectional encoders (default: True)</p></li>
<li><p><strong>rnn_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Type of rnn cell (rnn, lstm, gru) (default: lstm)</p></li>
<li><p><strong>joint_ctc_attention</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a>) – Flag indication joint ctc attention or not (default: False)</p></li>
<li><p><strong>max_length</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – Max decoding length. (default: 128)</p></li>
<li><p><strong>num_attention_heads</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of attention heads. (default: 4)</p></li>
<li><p><strong>decoder_dropout_p</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The dropout probability of decoder. (default: 0.2)</p></li>
<li><p><strong>decoder_attn_mechanism</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – The attention mechanism for decoder. (default: multi-head)</p></li>
<li><p><strong>teacher_forcing_ratio</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – The ratio of teacher forcing. (default: 1.0)</p></li>
<li><p><strong>optimizer</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Optimizer for training. (default: adam)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</div>
</div>


           </div>

          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="LSTM LM.html" class="btn btn-neutral float-right" title="LSTM Language Model" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="Jasper.html" class="btn btn-neutral float-left" title="Jasper" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2021, Kim, Soohwan and Ha, Sangchun and Cho, Soyoung.

    </p>
  </div>



    Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a

    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>

    provided by <a href="https://readthedocs.org">Read the Docs</a>.

</footer>
        </div>
      </div>

    </section>

  </div>


  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>






</body>
</html>